package edu.bupt.changelog.history.defaultsaver;

public class ChangedKV<O,N> {
    private String attrName;
    private O oldValue;
    private N newValue;

    public String getAttrName() {
        return attrName;
    }

    public void setAttrName(String attrName) {
        this.attrName = attrName;
    }

    public O getOldValue() {
        return oldValue;
    }

    public void setOldValue(O oldValue) {
        this.oldValue = oldValue;
    }

    public N getNewValue() {
        return newValue;
    }

    public void setNewValue(N newValue) {
        this.newValue = newValue;
    }

    public static <O,N> ChangedKV build(String attrName, O oldValue, N newValue){

        ChangedKV<O, N> onChangedKV = new ChangedKV<>();
        onChangedKV.setAttrName(attrName);
        onChangedKV.setOldValue(oldValue);
        onChangedKV.setNewValue(newValue);
        return onChangedKV;
    }
}
